#include "chat.h"
#include "ui_chat.h"
#include "addfriend.h"
#include "creategroup.h"
#include "addgroup.h"
Chat::Chat(SelfInfo info, TcpClient *tcp, QWidget *parent)
    : QWidget(parent), ui(new Ui::Chat), t(tcp), info(info) {
    ui->setupUi(this);
    ui->label->setText(QString("用户名：%1 账号：%2").arg(info.name).arg(info.account));
}

Chat::~Chat() { delete ui; }

void Chat::on_pushButton_2_clicked()
{
    auto addfriend = new AddFriend(info, t);
    addfriend->show();
}


void Chat::on_pushButton_3_clicked()
{
    auto creategroup = new createGroup(info, t);
    creategroup->show();
}


void Chat::on_pushButton_4_clicked()
{
    auto addgroup = new addGroup(info, t);
    addgroup->show();
}

